<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    li{
      height: 50px;
      line-height: 50px;
      background-color: rgb(141, 88, 88);
      margin-top:5px;
      width: 600px;
      color:#fff;
      font-size: 30px;
    }
  </style>
</head>
<body>
  <div id="app">
    <ul>
      <li 
        v-for="(el,index) in arr" 
        @click="change(index)"
        :key="index">
        {{ el }}
      </li>
    </ul>
    <hr>
    <ul>
      <li 
        v-for="(el,index) in arr2" 
        @click="change2(index)"
        :key="index">
        {{ el.a }}
      </li>
    </ul>
  </div>
  <script src="./vue.js"></script>
  <script>
    const  vm = new Vue({
      el: '#app',
      data:{
        arr: [1,2,3,4],
        arr2: [
          {
            a:10
          },
          {
            a:20
          },
          {
            a:30
          }
        ]
      },
      methods:{
        change(index){
          // this.arr[index] = 100;
          // console.log(this.arr)
          this.$set(this.arr,index,100)
        },
        change2(index){
          this.arr2[index].a = 100;
          console.log(this.arr)
        }
      }
    })
  </script>
</body>
</html>